import {createStore} from "vuex";

export default createStore({
    state: {
        allSource: ['携程', '美团', '抖音'],
        dateShortcuts: [
            {
                text: '今天', value: () => {
                    return [new Date(), new Date()];
                }
            },
            {
                text: '本周', value: () => {
                    const start = new Date();
                    const end = new Date();
                    start.setDate(start.getDate() - start.getDay() + 1);
                    end.setDate(start.getDate() + 7);
                    return [start, end];
                }
            },
            {
                text: '本月', value: () => {
                    const start = new Date(new Date().getFullYear(), new Date().getMonth(), 1);
                    const end = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0);
                    return [start, end];
                }
            }]
    },
    mutations: {},
    actions: {},
    modules: {}
})